import request from '@/utils/request'

export default {
    // 1. 讲师列表（条件查询）
    // 传入参数
    getTeacherListPage(current, limit, teacherQuery) {
        return request({
            url: `/eduservice/edu-teacher/pageTeacherCondition/${current}/${limit}`,
            // url: '/table/list/' + current + '/' + limit,
            method: 'post',
            // teacherQuery条件对象，后端使用RequestBody获取数据
            // data: 表示讲对象转成json对象传入
            data: teacherQuery
          })
    },

    // 2. 删除讲师
    removeDataById(teacherId) {
        return request({
            url: `/eduservice/edu-teacher/removeTeacher/${teacherId}`,
            // url: '/table/list/' + current + '/' + limit,
            method: 'delete',
            // teacherQuery条件对象，后端使用RequestBody获取数据
            // data: 表示讲对象转成json对象传入
            //data: teacherQuery
        })
    },

    // 3. 添加讲师
    addTeacher(teacher) {
        return request({
            url: `/eduservice/edu-teacher/addTeacher`,
            // url: '/table/list/' + current + '/' + limit,
            method: 'post',
            // teacherQuery条件对象，后端使用RequestBody获取数据
            // data: 表示讲对象转成json对象传入
            data: teacher
        })
    },
    // 4. 根据id获得讲师信息
    getTeacherInfo(id) {
        return request({
            url: `/eduservice/edu-teacher/getTeacher/${id}`,
            // url: '/table/list/' + current + '/' + limit,
            method: 'get',
            // teacherQuery条件对象，后端使用RequestBody获取数据
            // data: 表示讲对象转成json对象传入
            //data: teacher
        })
    },

    // 5. 修改讲师
    getUpdateTeacher(teacher) {
        return request({
            url: `/eduservice/edu-teacher/updateTeacher`,
            // url: '/table/list/' + current + '/' + limit,
            method: 'post',
            // teacherQuery条件对象，后端使用RequestBody获取数据
            // data: 表示讲对象转成json对象传入
            data: teacher
        })
    }
}

